<?php

 session_start();
 require('config/conn.php');
 header("Content-Type:text/html; charset=utf-8");
 $userName = trim($_POST['username']);
 $passWord = md5(trim($_POST['password']));
 $res = mysql_query("select password from user where username = '$userName'");
 $row = mysql_fetch_array($res);
 if($passWord == $row['password'])
 {
 	$_SESSION['username'] = $userName;
 	header('location:index.php');
 } else {
 	echo '<p style="text-align:center;margin-top:80px;">用户名或密码错误！&nbsp;&nbsp;<a href="login.html">返回</a></p>';
 }
 
?>
